import time

from app.modules.apps.container_tomcat import TomcatApp

tomcat = TomcatApp(app_id='debre:cwm',
                   app_name='cwm',
                   zone_home_path='/usr/local/app/uc.euaws.warehouse.debre',
                   zone_alias='debre',
                   port='27580',
                   nas_app_package_path='')

tomcat.uninstall_app()
tomcat.install_app()

tomcat.stop()
tomcat.uninstall_app()
tomcat.install_app()
tomcat.restart()
print tomcat.is_started()

time.sleep(3)
print tomcat.is_started()
time.sleep(3)
#tomcat.stop()
print tomcat.is_started()
